// 发布文章
(function () {
    let select = document.querySelector("#select")
    let title = document.querySelector('input[name="title"]')
    let label = document.querySelector('input[name="label"]')
    let sumbit_btn = document.querySelector('.sumbit_btn')
    sumbit_btn.onclick = function () {
        let classify = select.options[select.selectedIndex].text
        axios.post('/addarticle', {
            aname: title.value,
            label: label.value,
            classify: classify,
            content: editor.getHtml()
        })
            .then(function (response) {
                console.log(response);
                alert("发布成功")
                window.location.href = "./index.html"
                // response.data.code
            })


    }
})()